<template>
  <el-form-item label="是否自动排序" v-if="optionModel.hasOwnProperty('isAutoSort')">
    <el-switch v-model="optionModel.isAutoSort" @change="handleAutoSortChange"></el-switch>
  </el-form-item>
</template>

<script>
  import i18n from "@/utils/i18n"

  export default {
    name: "isAutoSort-editor",
    mixins: [i18n],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
    },
    methods: {
      handleAutoSortChange(val) {
        if (!val) {
          this.optionModel.subAutoSort = '';
          this.optionModel.subAutoSortCode = '';
        }
      },
    }
  }
</script>

<style scoped>

</style>
